<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>Document</title>
	</head>
	<body>
		<script type="text/javascript" >
			let arr1=[1,2,3,4,5];
            let arr2=[2,4,5,6,7];
            console.log(...arr1);
            let arr3=[...arr1,...arr2]
            console.log(arr3)
            let arr4= arr3.map((value,index)=>value+1
            )
            console.log(arr4)
            let arr5= arr3.map((value,index)=>{
                console.log(value,"----",index)
                return value+1
            })
            console.log(arr5)
            // 在函数中使用f
            function sum (...numbers){
                return numbers.reduce((preValue,currentValue)=>{
                    return preValue+currentValue
                })
            }
            console.log(sum(1,2,3,4));
            // 构造字面量对象
            let person ={name:"tom",age:18};
            let person2={...person}
            // 报错
            // person.name="jerry";
            // console.log(person2)
            // console.log(person)
            // 合并
            let person3={...person,...person2,name:"jack",address:"地球"}
            console.log(person3)

            // 

			
		</script>
	</body>
</html>